package com.iotimc.attendancesystem.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.iotimc.attendancesystem.entity.AttendanceLogEntity;
import com.iotimc.attendancesystem.entity.BasicSettingEntity;
import com.iotimc.attendancesystem.entity.DoorLogEntity;
import com.iotimc.attendancesystem.entity.PersonEntity;
import com.iotimc.attendancesystem.entity.SystemEntity;

import com.iotimc.attendancesystem.dao.AttendanceLogEntityDao;
import com.iotimc.attendancesystem.dao.BasicSettingEntityDao;
import com.iotimc.attendancesystem.dao.DoorLogEntityDao;
import com.iotimc.attendancesystem.dao.PersonEntityDao;
import com.iotimc.attendancesystem.dao.SystemEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig attendanceLogEntityDaoConfig;
    private final DaoConfig basicSettingEntityDaoConfig;
    private final DaoConfig doorLogEntityDaoConfig;
    private final DaoConfig personEntityDaoConfig;
    private final DaoConfig systemEntityDaoConfig;

    private final AttendanceLogEntityDao attendanceLogEntityDao;
    private final BasicSettingEntityDao basicSettingEntityDao;
    private final DoorLogEntityDao doorLogEntityDao;
    private final PersonEntityDao personEntityDao;
    private final SystemEntityDao systemEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        attendanceLogEntityDaoConfig = daoConfigMap.get(AttendanceLogEntityDao.class).clone();
        attendanceLogEntityDaoConfig.initIdentityScope(type);

        basicSettingEntityDaoConfig = daoConfigMap.get(BasicSettingEntityDao.class).clone();
        basicSettingEntityDaoConfig.initIdentityScope(type);

        doorLogEntityDaoConfig = daoConfigMap.get(DoorLogEntityDao.class).clone();
        doorLogEntityDaoConfig.initIdentityScope(type);

        personEntityDaoConfig = daoConfigMap.get(PersonEntityDao.class).clone();
        personEntityDaoConfig.initIdentityScope(type);

        systemEntityDaoConfig = daoConfigMap.get(SystemEntityDao.class).clone();
        systemEntityDaoConfig.initIdentityScope(type);

        attendanceLogEntityDao = new AttendanceLogEntityDao(attendanceLogEntityDaoConfig, this);
        basicSettingEntityDao = new BasicSettingEntityDao(basicSettingEntityDaoConfig, this);
        doorLogEntityDao = new DoorLogEntityDao(doorLogEntityDaoConfig, this);
        personEntityDao = new PersonEntityDao(personEntityDaoConfig, this);
        systemEntityDao = new SystemEntityDao(systemEntityDaoConfig, this);

        registerDao(AttendanceLogEntity.class, attendanceLogEntityDao);
        registerDao(BasicSettingEntity.class, basicSettingEntityDao);
        registerDao(DoorLogEntity.class, doorLogEntityDao);
        registerDao(PersonEntity.class, personEntityDao);
        registerDao(SystemEntity.class, systemEntityDao);
    }
    
    public void clear() {
        attendanceLogEntityDaoConfig.clearIdentityScope();
        basicSettingEntityDaoConfig.clearIdentityScope();
        doorLogEntityDaoConfig.clearIdentityScope();
        personEntityDaoConfig.clearIdentityScope();
        systemEntityDaoConfig.clearIdentityScope();
    }

    public AttendanceLogEntityDao getAttendanceLogEntityDao() {
        return attendanceLogEntityDao;
    }

    public BasicSettingEntityDao getBasicSettingEntityDao() {
        return basicSettingEntityDao;
    }

    public DoorLogEntityDao getDoorLogEntityDao() {
        return doorLogEntityDao;
    }

    public PersonEntityDao getPersonEntityDao() {
        return personEntityDao;
    }

    public SystemEntityDao getSystemEntityDao() {
        return systemEntityDao;
    }

}
